<!--[if lt IE 9]>
<script src="plugins/respond.min.js"></script>
<script src="plugins/excanvas.min.js"></script>
<script type="text/javascript" src="plugins/jQuery/jquery-1.11.1.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<!--<![endif]-->
<script src="/plugins/jquery-ui/jquery-ui-1.10.2.custom.min.js"></script>
<script src="/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/plugins/iCheck/jquery.icheck.min.js"></script><!--文本框-->
<script src="/plugins/perfect-scrollbar/src/jquery.mousewheel.js"></script>
<script src="/plugins/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<script src="/plugins/bootbox/bootbox.min.js"></script><!--弹出框-->
<script src="/plugins/jquery.scrollTo/jquery.scrollTo.min.js"></script>
<script src="/plugins/ScrollToFixed/jquery-scrolltofixed-min.js"></script><!--固定页面元素-->
<script src="/plugins/velocity/jquery.velocity.min.js"></script><!--动画插件-->
<script src="/plugins/SweetAlert/sweetalert.min.js"></script><!--alert插件-->
<script src="/js/jquery.form.js"></script><!--form表单插件-->
<script src="/js/jquery.sparkline.js"></script><!--插件-->
<script src="/js/moment.js"></script><!--JavaScript日期处理库-->
<script src="/js/index.js"></script>
<script src="/js/main.js"></script>
<script src="/js/sweetalert-dev.js"></script>
<script src="/plugins/fileinput/js/fileinput.min.js"></script><!--fileinput-->
<script src="/plugins/fileinput/js/fileinput_locale_zh.js"></script>
<script src="/plugins/datetimepicker/js/bootstrap-datetimepicker.min.js"></script><!--datetimepicker-->
<script src="/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script><!--datetimepicker-->
<script>
    jQuery(document).ready(function() {
        Main.init();
        //SVExamples.init();
        Index.init();
    });
</script>

<script>
$(function() {
    $(".fakeloader").fakeLoader({
        timeToHide:500,
        bgColor:"#222",
        spinner:"spinner7"
    });

    $('#main-navigation-menu > li').removeClass('active');
    url = window.location.pathname;

    $('#main-navigation-menu > li').each(function(i){
        var ul_children = $(this).children('ul').html();
        if(ul_children != undefined){
            ul_children = $(this).children('ul')
            $(ul_children).children('li').each(function(){
                menu_url = $(this).children('a').attr('href');
            });
        }else{
            menu_url = $(this).children('a').attr('href');
            patt1 = new RegExp(menu_url);
            //alert(url);
            if(patt1.test(url)){
                $(this).addClass('active');
            }
        }
    })
})
function cg_alert_add(obj,list_url,add_url){
    if(obj.status == 1){
        swal({
            title: obj.msg,
            confirmButtonText:'继续添加',
            confirmButtonColor: "#DD6B55",
            showCancelButton: true,
            cancelButtonText:'返回列表',
            type: "success",
        },function(isConfirm){
            if (isConfirm) {
                location.href = add_url;
            }else{
                location.href = list_url;
            }
        });
    }else{
        swal(obj.msg,'','error');
    }

}
function cg_alert_edit(obj,list_url,edit_url){
    if(obj.status == 1){
        swal({
            title: obj.msg,
            confirmButtonText:'继续修改',
            confirmButtonColor: "#DD6B55",
            showCancelButton: true,
            cancelButtonText:'返回列表',
            type: "success",
        },function(isConfirm){
            if (isConfirm) {
                location.href = edit_url;
            }else{
                location.href = list_url;
            }
        });
    }else{
        swal(obj.msg,'','error');
    }

}
function cg_confirm_del(del_url,jump_url){
    swal({
            title: '您确定要删除吗？',
            text:'删除之后不能恢复',
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText:'确定',
            closeOnConfirm: false,
            cancelButtonText:'取消'
        },
        function(isConfirm){
            if(isConfirm){
                window.obj = '';
                $.ajax({
                    url: del_url,
                    dataType: "json",
                    async:false,
                    success: function (obj) {
                        window.obj = obj;
                    }
                });

                if(window.obj.status == 1){
                    swal({title:"删除成功!", type:"success"},function(){
                        location.href = jump_url;
                    });
                }else{
                    swal({title:window.obj.msg, type:"error"});
                }
            }
        });
}
</script>

    </body>
    <!-- end: BODY -->
</html>
